package com.njsoft.bodyawakening.view;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

/**
 * Toast.setGravity(gravity,xOffset,yOffset);
 * gravity:toast的位置
 * xOffset:相对于gravity x方向上的偏移量。yOffset:相对于gravity y方向的偏移量。
 *
 * @author cui
 */
public class MyToast {
    public static void show(Context context, String data) {
        if (context == null) {
            return;
        }
        Toast toast = Toast.makeText(context, data, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }
}
